package com.gm.app.data;

import javax.persistence.TypedQuery;

import org.springframework.beans.factory.annotation.Configurable;

import com.gm.app.model.Resident;

@Configurable
public class ResidentDAO extends RegisterDAO {

	private static ResidentDAO dao = null;

	public static ResidentDAO get() {
		if (dao == null) {
			dao = new ResidentDAO();
		}
		return dao;
	}

	public static TypedQuery<Resident> search(String name, String address,
			String country, String comments, Integer start, Integer page) {
		return ResidentDAO.get().search(name, address, country, comments,
				start, page, Resident.class);
	}

	public static TypedQuery<Resident> search(String name, String address,
			String country, String comments) {
		return ResidentDAO.get().search(name, address, country, comments, null,
				null, Resident.class);
	}

}
